<!--
*Author：富行天下团队
 *
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/Mall_producttype.js此处编写
 -->
<template>
  <div>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" :editFormFileds="editFormFields" :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields" :searchFormFileds="searchFormFields" :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
    </view-grid>
  </div>
</template>

<script>
import extend from '@/extension/mall/Mall_producttype.js'
import ViewGrid from '@/components/basic/ViewGrid.vue'
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: 'id',
        footer: 'Foots',
        cnName: '产品类型',
        name: 'producttypes',
        url: '/producttypes/',
        sortName: 'createDate',
      },
      extend: extend,
      editFormFields: {
        sort: '',
        isMessage: '1',
        smsModeName: '',
        signCode: '',
        isAddCart: '',
        smsName: '',
        smsNote: '',
        contactPerson: '',
        contactPhone: '',
        typeCode: '',
        uiType: '',
        typeName: '',
        parentID: [],
        roleId: [],
        attributes: [],
        parentName: '',
        uiTypeName: '',
        modifyDate: '',
        createDate: '',
        roleId: '',
        creator: '',
        createID: '',
        createDate: '',
        modifier: '',
        modifyID: '',
        modifyDate: '',
        merchantCode: '',
        merchantName: '',
        isAvailable: '',
        isShow: '',
        black_ico: [],
        color_ico: [],
        isDelivery:0,
        isPickup:0,
      },
      editFormOptions: [
        [
          { title: '类型名称', required: true, field: 'typeName', width: 140, colSize: 3, type: 'text' },
          { title: '父级类型', field: 'parentName', type: 'text', hidden: true, colSize: 3 },
          { title: '父级类型', required: true, field: 'parentID', type: 'cascader', dataKey: 'type_trees', data: [], colSize: 3 },
          { title: 'ui类型', field: 'uiType', type: 'select', dataKey: 'uiType', colSize: 3 },
          { title: '排序', field: 'sort', type: 'number', colSize: 3 },
        ],
        [
          { title: '属性', field: 'attributes', type: 'checkbox', dataKey: 'mall_type', colSize: 6 },
          {
            title: '添加购物车',
            field: 'isAddCart',
            type: 'radio',
            data: [
              { key: '0', value: '是' },
              { key: '1', value: '否' },
            ],
            colSize: 6,
          },
        ],
        [{ title: '产品类型编码', field: 'typeCode', type: 'text', hidden: true }],
        [
          { title: '黑白图', maxSize: 1, field: 'black_ico', type: 'imgupgrade', colSize: 6 },
          { title: '彩图', maxSize: 1, field: 'color_ico', type: 'imgupgrade', colSize: 6 },
        ],
        [
          { title: '是否发送短信', field: 'isMessage', type: 'switch', hidden: false, colSize: 6 },
          { dataKey: 'sms_mode', data: [], title: '短信模式', field: 'smsModeName', type: 'select', hidden: false, colSize: 6 },
        ],
        [
          { dataKey: 'Signs', data: [], title: '短信签名', field: 'signCode', type: 'select', hidden: false, colSize: 6 },
          { dataKey: 'Messages', data: [], title: '短信模板', field: 'smsName', type: 'select', hidden: false, colSize: 6 },
        ],
        [{ title: '模板内容', field: 'smsNote', type: 'text', hidden: false, disabled: true, colSize: 12 }],
        [{ title: '是否发货', field: 'isDelivery',type: 'switch', colSize: 3},
        { title: '是否自提', field: 'isPickup',type: 'switch',colSize: 3},],
        [
          { title: '联系人', field: 'contactPerson', type: 'text', colSize: 6 },
          { title: '联系人电话', field: 'contactPhone', type: 'text', colSize: 6 },
        ],
      ],
      searchFormFields: { typeCode: '', typeName: '', isAvailable: '', creator: '', createDate: '', modifyDate: '' },
      //{"title":"ui类型","field":"uiType","type":"select","dataKey": "uiType"},{"title":"是否展示","field":"isShow","type":"select","dataKey":"enable"}{"title":"是否可用","field":"isAvailable","type":"select","dataKey":"enable"},
      searchFormOptions: [
        [
          { title: '产品类型名称', field: 'typeName', type: 'like' },
          { title: '创建时间', field: 'createDate', type: 'datetime' },
        ],
      ],
      columns: [
        { field: 'id', title: '主键', type: 'int', width: 90, hidden: true, readonly: true, require: true, align: 'left' },
        //{field:'typeCode',title:'产品类型编码',type:'string',width:220,align:'left',sortable:true},
        { field: 'typeName', title: '产品类型名称', type: 'string', width: 220, align: 'left' },
        { field: 'attributeName', title: '属性', bind: { key: 'mall_type', data: [] }, type: 'string', width: 280, align: 'left' },
        //{field:'attributeName',title:'属性名称',type:'string',width:120,align:'left'},
        // {field:'isDelete',title:'是否删除',type:'int',width:90,require:true,align:'left'},
        // {field:'roleId',title:'分销商编码',type:'string',width:120,align:'left'},
        { field: 'sort', title: '排序', type: 'int', width: 120, require: true, align: 'left' },
        { field: 'black_ico', title: '黑白图', type: 'imgupgrade', width: 120, require: true, align: 'left' },
        { field: 'color_ico', title: '彩图', type: 'imgupgrade', width: 120, require: true, align: 'left' },
        { field: 'uiType', title: 'ui类型', bind: { key: 'uiType', data: [] }, type: 'string', width: 100, align: 'left' },
        {
          field: 'isAddCart',
          title: '添加购物车',
          bind: {
            key: '',
            data: [
              { key: '0', value: '是' },
              { key: '1', value: '否' },
            ],
          },
          type: 'string',
          width: 100,
          align: 'left',
        },
        //    {field:'isAvailable',title:'是否可用',bind: { key: 'enable', data: [] },type:'int',width:90,align:'left'},
        //    {field:'isShow',title:'是否展示',bind: { key: 'enable', data: [] },type:'int',width:90,align:'left'},
        //{field:'modifyID',title:'修改人ID',type:'int',width:90,hidden:true,align:'left'},
        { field: 'createDate', title: '创建时间', type: 'datetime', width: 120, align: 'left', sortable: true },
        //{field:'createID',title:'创建人ID',type:'int',width:90,hidden:true,align:'left'},
        // {field:'roleId',title:'roleId',type:'string',width:120,align:'left',sortable:true},
        { field: 'creator', title: '创建人', type: 'string', width: 100, align: 'left' },
        { field: 'modifier', title: '修改人', type: 'string', width: 100, align: 'left' },
        { field: 'modifyDate', title: '修改时间', type: 'datetime', width: 135, align: 'left', sortable: true },
      ],
      detail: {
        cnName: '#detailCnName',
        columns: [],
        sortName: '',
        key: '',
      },
    }
  },
}
export default vueParam
</script>

<style lang="scss">
</style>
